Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib/systems/platforms.nix: use "32" instead of "o32" for mips32 ABI #170736

Merged
merged 1 commit into from Jul 27, 2022
Merged

lib/systems/platforms.nix: use "32" instead of "o32" for mips32 ABI #170736

merged 1 commit into from Jul 27, 2022

Conversation

ghost
Copy link

@ghost ghost commented Apr 28, 2022

Description of changes

There is only one ABI for 32-bit MIPS chips. Before mips64, it didn't really have a name.

The 64-bit MIPS ABI comes in two flavors, "n64" and "n32". It is commonplace to refer to the old 32-bit ABI as "o32" (MIPS and SGI documents do this).

However, when configuring gcc, one must use --with-abi=32, not --with-abi=o32.

Let's keep GCC happy with this commit.

Things done
  • Built on platform(s)
    • mips64el-linux
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

There is only one ABI for 32-bit MIPS chips.  Before mips64, it didn't
really have a name.

The 64-bit MIPS ABI comes in two flavors, "n64" and "n32".  It is
commonplace to refer to the old 32-bit ABI as "o32" (MIPS and SGI
documents do this).

However, when configuring gcc, one must use --with-abi=32, not
--with-abi=o32.

Let's keep GCC happy with this commit.
@ghost
Copy link
Author

ghost commented Jun 19, 2022

Ping...

This is a pretty low-risk merge.

@ghost
Copy link
Author

ghost commented Jul 11, 2022

Ping

@vcunat vcunat merged commit 87980a5 into NixOS:master Jul 27, 2022
@vcunat
Copy link
Member

vcunat commented Jul 27, 2022

OK, this seems like a step forward, but locally it's not a full success for me:

$ nix build -f pkgs/top-level/release-cross.nix bootstrapTools.mipsel-linux-gnu.bootstrapTools
error: builder for '/nix/store/nvl5dzg752jzrpnan9c0chv9rpd2i77y-bootstrap-tools.drv' failed with exit code 1;
       last 2 log lines:
       > 
       > ErrorErrorhexecuting '/nix/store/ywbgw67hrx1yj6kcg8d77nnyf987dwkw-busybox': Exec format error

@ghost
Copy link
Author

ghost commented Jul 27, 2022

nix build -f pkgs/top-level/release-cross.nix bootstrapTools.mipsel-linux-gnu.bootstrapTools

I'm running this now at master but it will be an hour or two before it gets caught up.

@ghost
Copy link
Author

ghost commented Jul 27, 2022

I think this might be more fallout from #168650 if this works for you:

nix build -f . pkgsCross.mipsel-linux-gnu.stdenvBootstrapTools.build

That's what I was testing with.

Once my build gets caught up I'll check, and make sure that #183072 fixes it. (Edit: this is unrelated to #168650 / #183072)

@vcunat
Copy link
Member

vcunat commented Jul 27, 2022

Yes, that does succeed (cached from the attempt above apparently). My command above only fails in the very last build step.

@ghost
Copy link
Author

ghost commented Jul 27, 2022

My command above only fails in the very last build step.

Oh, in that case it isn't #168650, and I think Hydra will be fine (but still checking anyways -- about halfway built).

I seem to recall running into that error before... release-cross.nix is pretty convoluted, but it boiled down to bootstrapTools being an attrset-of-derivations, one of which tries to execute the tools.

@ghost
Copy link
Author

ghost commented Jul 27, 2022

Yeah Hydra will be fine.

nix@moore:/git/nixpkgs$ nix-instantiate pkgs/top-level/release-cross.nix -A bootstrapTools.mipsel-linux-gnu
/nix/store/b6d509dr6anhc46q7ggnzkcn2a7dpfbn-binutils-mipsel-unknown-linux-gnu-2.38.drv
/nix/store/d3q6wxfsfqdqz66rykrmfdrym8yac7sp-gcc-debug-mipsel-unknown-linux-gnu-10.4.0.drv
/nix/store/g2aii8hfmy18xjagbip25p9sigxjic5c-stdenv-bootstrap-tools-mipsel-unknown-linux-gnu.drv
/nix/store/wsgr73yzvjmj7rcg6izvv1iml998bcpg-busybox-mipsel-unknown-linux-gnu-1.35.0.drv
/nix/store/xk24cqi2fns7shi2xi7nwh3g7rqzyvkg-coreutils-mipsel-unknown-linux-gnu-9.1.drv
/nix/store/1292868idj07b8qmagk4qyq11ygqy6wj-stdenv-bootstrap-tools-mipsel-unknown-linux-gnu.drv
/nix/store/n50lqs93nxr3kffmw5z19ar0r1rgh3zd-gnutar-mipsel-unknown-linux-gnu-1.34.drv
/nix/store/nvl5dzg752jzrpnan9c0chv9rpd2i77y-bootstrap-tools.drv
/nix/store/j8c9bjpxdijpl56k93y34qz66jn0fbjq-test-bootstrap-tools.drv

(I reordered the lines above) The last two derivations can only be built on host==build.

However this will work:

nix-instantiate pkgs/top-level/release-cross.nix -A bootstrapTools.mipsel-linux-gnu | grep -v 'tools.drv' | xargs nix build -L

Also,

nix show-derivation /nix/store/j8c9bjpxdijpl56k93y34qz66jn0fbjq-test-bootstrap-tools.drv | grep system
    "system": "mipsel-linux",
      "system": "mipsel-linux"

I think there's something in the hydraJob machinery that makes sure it skips jobs where drv.system!=builtins.currentSystem since these can never be expected to work correctly.

@ghost ghost deleted the fix-mips32-abi-setting branch July 27, 2022 20:49
@ghost
Copy link
Author

ghost commented Jul 28, 2022

Yeah Hydra will be fine.

All good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant